/*!
 \file      Example1.cpp

 \brief     Example code source for class serialib.
            This example open the device on ttyACM0.
            (USB to RS232 converter under linux).
            If the opening is successful, it sends the AT command
            and waits for a string being received from the device.
            After 5 seconds, if no valid data are received from the
            device, reception is giving up.

 \author    Philippe Lucidarme
 \version   1.0
 \date      05/01/2011
 */

#include <iostream>
#include "esp301-control.h"

int main()
{


  try
    {

esp301_control Motion_controller;

Motion_controller.moveTo(6);

double dx = 0.0005;
for(int i=0;i<100;i++)
{
Motion_controller.moveBy(dx);

float displacement;
displacement = Motion_controller.getPosition();

std::cout << "Current position:" << displacement << "\tTheoretical position: " << 
	Motion_controller.theoretical_displacement << std::endl;
}


    }
  catch (char const * str_err)
    {
      std::cerr << "[ERROR] " << str_err << std::endl;
      return 1;
    }

  return 0;
}




